<template>
  <div class="module-wrap">
    <div class="module-title" v-if="title"><span class="point"></span>{{ title }}</div>
    <div :class="{'module-content': true, 'has-title': title}">
      <slot></slot>
    </div>
  </div>
</template>
<script lang="ts" setup>
const { title } = defineProps(['title'])
</script>
<style lang="scss" scoped>
  .module-wrap{
    width: 100%;
    .module-title{
      display: flex;
      align-items: center;
      color: #fff;
      height: 20px;
      line-height: 20px;
      padding: 10px;
      box-shadow: 0 0 12px rgba(255, 255, 255, .12) inset;
      border: 1px solid #ffffff4d;
      border-bottom: none;
      .point{
        display: inline-block;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #19C8F2;
        margin-right: 10px;
      }
    }
    .module-content{
      box-shadow: 0 0 12px rgba(255, 255, 255, .12) inset;
      border: 1px solid #ffffff4d;
      padding: 5px;
      height: 100%;
      box-sizing: border-box;
      &.has-title{
        height: calc(100% - 50px);
      }
    }
  }
</style>